﻿
using Tszy.Examples.Domain.Services.Users.Domain;

namespace Tszy.Examples.Domain.Services.Users.Infrastructure;

internal interface IUserRepository
{
    void Add(DomainUser user);
}

public class UserRepository : IUserRepository
{
    //private readonly ITszyDbContext _dbContext;

    //public UserRepository()
    //{
    //    var connectionString = "server=localhost;port=3306;uid=root;pwd=111111;database=test;charset=utf8;SslMode=None;AllowPublicKeyRetrieval=True";
    //    _dbContext = new TszyMysqlDbContext(() => new MySqlConnection(connectionString), false, m => Console.WriteLine(m));
    //}

    //public void Add(DomainUser user)
    //{
    //    var dbmodel = new DbDomainUser { Id = user.Identity, Name = user.Name, Created = user.Created };

    //    _dbContext.Add(dbmodel);
    //}
    public void Add(DomainUser user)
    {
        throw new NotImplementedException();
    }
}

//public class DbDomainUser : DbModelIdentityGuid
//{
//    public string Name { get; set; } = String.Empty;
//    public DateTime Created { get; set; } = DateTime.Now;

//    public override string GetTableName()
//    {
//        return "test_user";
//    }
//}